home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume9 / uemacs3.8b / part11 < prev    next >
Encoding:
Internet Message Format  |  1987-03-16  |  55.5 KB

  1. Subject:  v09i043:  MicroEMACS, version3.8b, Part11/14
  2. Newsgroups: mod.sources
  3. Approved: rs@mirror.TMC.COM
  4.  
  5. Submitted by: ihnp4!itivax!duncan!lawrence (Daniel Lawrence)
  6. Mod.sources: Volume 9, Issue 43
  7. Archive-name: uemacs3.8b/Part11
  8.  
  9. #! /bin/sh
  10. # This is a shell archive.  Remove anything before this line,
  11. # then unpack it by saving it in a file and typing "sh file".
  12. # If this archive is complete, you will see the message:
  13. #        "End of archive 11 (of 14)."
  14. # Contents:  display.c emacs.tut
  15. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  16. echo shar: Extracting \"display.c\" \(23826 characters\)
  17. if test -f display.c ; then 
  18.   echo shar: Will not over-write existing file \"display.c\"
  19. else
  20. sed "s/^X//" >display.c <<'END_OF_display.c'
  21. X/*
  22. X * The functions in this file handle redisplay. There are two halves, the
  23. X * ones that update the virtual display screen, and the ones that make the
  24. X * physical display screen the same as the virtual display screen. These
  25. X * functions use hints that are left in the windows by the commands.
  26. X *
  27. X */
  28. X
  29. X#include        <stdio.h>
  30. X#include    "estruct.h"
  31. X#include        "edef.h"
  32. X
  33. X#if    MEGAMAX & ST520
  34. Xoverlay    "display"
  35. X#endif
  36. X
  37. Xtypedef struct  VIDEO {
  38. X        int    v_flag;                 /* Flags */
  39. X#if    COLOR
  40. X    int    v_fcolor;        /* current forground color */
  41. X    int    v_bcolor;        /* current background color */
  42. X    int    v_rfcolor;        /* requested forground color */
  43. X    int    v_rbcolor;        /* requested background color */
  44. X#endif
  45. X        char    v_text[1];              /* Screen data. */
  46. X}       VIDEO;
  47. X
  48. X#define VFCHG   0x0001                  /* Changed flag            */
  49. X#define    VFEXT    0x0002            /* extended (beyond column 80)    */
  50. X#define    VFREV    0x0004            /* reverse video status        */
  51. X#define    VFREQ    0x0008            /* reverse video request    */
  52. X#define    VFCOL    0x0010            /* color change requested    */
  53. X
  54. XVIDEO   **vscreen;                      /* Virtual screen. */
  55. X#if    MEMMAP == 0
  56. XVIDEO   **pscreen;                      /* Physical screen. */
  57. X#endif
  58. X
  59. X/*
  60. X * Initialize the data structures used by the display code. The edge vectors
  61. X * used to access the screens are set up. The operating system's terminal I/O
  62. X * channel is set up. All the other things get initialized at compile time.
  63. X * The original window has "WFCHG" set, so that it will get completely
  64. X * redrawn on the first call to "update".
  65. X */
  66. Xvtinit()
  67. X{
  68. X    register int i;
  69. X    register VIDEO *vp;
  70. X    char *malloc();
  71. X
  72. X    TTopen();        /* open the screen */
  73. X    TTkopen();        /* open the keyboard */
  74. X    TTrev(FALSE);
  75. X    vscreen = (VIDEO **) malloc(term.t_nrow*sizeof(VIDEO *));
  76. X
  77. X    if (vscreen == NULL)
  78. X        exit(1);
  79. X
  80. X#if    MEMMAP == 0
  81. X    pscreen = (VIDEO **) malloc(term.t_nrow*sizeof(VIDEO *));
  82. X
  83. X    if (pscreen == NULL)
  84. X        exit(1);
  85. X#endif
  86. X
  87. X    for (i = 0; i < term.t_nrow; ++i)
  88. X        {
  89. X        vp = (VIDEO *) malloc(sizeof(VIDEO)+term.t_mcol);
  90. X
  91. X        if (vp == NULL)
  92. X            exit(1);
  93. X
  94. X    vp->v_flag = 0;
  95. X#if    COLOR
  96. X    vp->v_rfcolor = 7;
  97. X    vp->v_rbcolor = 0;
  98. X#endif
  99. X        vscreen[i] = vp;
  100. X#if    MEMMAP == 0
  101. X        vp = (VIDEO *) malloc(sizeof(VIDEO)+term.t_mcol);
  102. X
  103. X        if (vp == NULL)
  104. X            exit(1);
  105. X
  106. X    vp->v_flag = 0;
  107. X        pscreen[i] = vp;
  108. X#endif
  109. X        }
  110. X}
  111. X
  112. X/*
  113. X * Clean up the virtual terminal system, in anticipation for a return to the
  114. X * operating system. Move down to the last line and clear it out (the next
  115. X * system prompt will be written in the line). Shut down the channel to the
  116. X * terminal.
  117. X */
  118. Xvttidy()
  119. X{
  120. X    mlerase();
  121. X    movecursor(term.t_nrow, 0);
  122. X    TTflush();
  123. X    TTclose();
  124. X    TTkclose();
  125. X}
  126. X
  127. X/*
  128. X * Set the virtual cursor to the specified row and column on the virtual
  129. X * screen. There is no checking for nonsense values; this might be a good
  130. X * idea during the early stages.
  131. X */
  132. Xvtmove(row, col)
  133. X{
  134. X    vtrow = row;
  135. X    vtcol = col;
  136. X}
  137. X
  138. X/* Write a character to the virtual screen. The virtual row and
  139. X   column are updated. If we are not yet on left edge, don't print
  140. X   it yet. If the line is too long put a "$" in the last column.
  141. X   This routine only puts printing characters into the virtual
  142. X   terminal buffers. Only column overflow is checked.
  143. X*/
  144. X
  145. Xvtputc(c)
  146. X
  147. Xint c;
  148. X
  149. X{
  150. X    register VIDEO *vp;    /* ptr to line being updated */
  151. X
  152. X    vp = vscreen[vtrow];
  153. X
  154. X    if (c == '\t') {
  155. X        do {
  156. X            vtputc(' ');
  157. X        } while (((vtcol + taboff)&0x07) != 0);
  158. X    } else if (vtcol >= term.t_ncol) {
  159. X        ++vtcol;
  160. X        vp->v_text[term.t_ncol - 1] = '$';
  161. X    } else if (c < 0x20 || c == 0x7F) {
  162. X        vtputc('^');
  163. X        vtputc(c ^ 0x40);
  164. X    } else {
  165. X        if (vtcol >= 0)
  166. X            vp->v_text[vtcol] = c;
  167. X        ++vtcol;
  168. X    }
  169. X}
  170. X
  171. X/*
  172. X * Erase from the end of the software cursor to the end of the line on which
  173. X * the software cursor is located.
  174. X */
  175. Xvteeol()
  176. X{
  177. X    register VIDEO      *vp;
  178. X
  179. X    vp = vscreen[vtrow];
  180. X    while (vtcol < term.t_ncol)
  181. X        vp->v_text[vtcol++] = ' ';
  182. X}
  183. X
  184. X/* upscreen:    user routine to force a screen update
  185. X        always finishes complete update        */
  186. X
  187. Xupscreen(f, n)
  188. X
  189. X{
  190. X    update(TRUE);
  191. X    return(TRUE);
  192. X}
  193. X
  194. X/*
  195. X * Make sure that the display is right. This is a three part process. First,
  196. X * scan through all of the windows looking for dirty ones. Check the framing,
  197. X * and refresh the screen. Second, make sure that "currow" and "curcol" are
  198. X * correct for the current window. Third, make the virtual and physical
  199. X * screens the same.
  200. X */
  201. Xupdate(force)
  202. X
  203. Xint force;    /* force update past type ahead? */
  204. X
  205. X{
  206. X    register WINDOW *wp;
  207. X
  208. X#if    TYPEAH
  209. X    if (force == FALSE && typahead())
  210. X        return(TRUE);
  211. X#endif
  212. X#if    VISMAC == 0
  213. X    if (force == FALSE && kbdmode == PLAY)
  214. X        return(TRUE);
  215. X#endif
  216. X
  217. X    /* update any windows that need refreshing */
  218. X    wp = wheadp;
  219. X    while (wp != NULL) {
  220. X        if (wp->w_flag) {
  221. X            /* if the window has changed, service it */
  222. X            reframe(wp);    /* check the framing */
  223. X            if ((wp->w_flag & ~WFMODE) == WFEDIT)
  224. X                updone(wp);    /* update EDITed line */
  225. X            else if (wp->w_flag & ~WFMOVE)
  226. X                updall(wp);    /* update all lines */
  227. X            if (wp->w_flag & WFMODE)
  228. X                modeline(wp);    /* update modeline */
  229. X            wp->w_flag = 0;
  230. X            wp->w_force = 0;
  231. X        }
  232. X        /* on to the next window */
  233. X        wp = wp->w_wndp;
  234. X    }
  235. X
  236. X    /* recalc the current hardware cursor location */
  237. X    updpos();
  238. X
  239. X#if    MEMMAP
  240. X    /* update the cursor and flush the buffers */
  241. X    movecursor(currow, curcol - lbound);
  242. X#endif
  243. X
  244. X    /* check for lines to de-extend */
  245. X    upddex();
  246. X
  247. X    /* if screen is garbage, re-plot it */
  248. X    if (sgarbf != FALSE)
  249. X        updgar();
  250. X
  251. X    /* update the virtual screen to the physical screen */
  252. X    updupd(force);
  253. X
  254. X    /* update the cursor and flush the buffers */
  255. X    movecursor(currow, curcol - lbound);
  256. X    TTflush();
  257. X    return(TRUE);
  258. X}
  259. X
  260. X/*    reframe:    check to see if the cursor is on in the window
  261. X            and re-frame it if needed or wanted        */
  262. X
  263. Xreframe(wp)
  264. X
  265. XWINDOW *wp;
  266. X
  267. X{
  268. X    register LINE *lp;
  269. X    register int i;
  270. X
  271. X    /* if not a requested reframe, check for a needed one */
  272. X    if ((wp->w_flag & WFFORCE) == 0) {
  273. X        lp = wp->w_linep;
  274. X        for (i = 0; i < wp->w_ntrows; i++) {
  275. X
  276. X            /* if the line is in the window, no reframe */
  277. X            if (lp == wp->w_dotp)
  278. X                return(TRUE);
  279. X
  280. X            /* if we are at the end of the file, reframe */
  281. X            if (lp == wp->w_bufp->b_linep)
  282. X                break;
  283. X
  284. X            /* on to the next line */
  285. X            lp = lforw(lp);
  286. X        }
  287. X    }
  288. X
  289. X    /* reaching here, we need a window refresh */
  290. X    i = wp->w_force;
  291. X
  292. X    /* how far back to reframe? */
  293. X    if (i > 0) {        /* only one screen worth of lines max */
  294. X        if (--i >= wp->w_ntrows)
  295. X            i = wp->w_ntrows - 1;
  296. X    } else if (i < 0) {    /* negative update???? */
  297. X        i += wp->w_ntrows;
  298. X        if (i < 0)
  299. X            i = 0;
  300. X    } else
  301. X        i = wp->w_ntrows / 2;
  302. X
  303. X    /* backup to new line at top of window */
  304. X    lp = wp->w_dotp;
  305. X    while (i != 0 && lback(lp) != wp->w_bufp->b_linep) {
  306. X        --i;
  307. X        lp = lback(lp);
  308. X    }
  309. X
  310. X    /* and reset the current line at top of window */
  311. X    wp->w_linep = lp;
  312. X    wp->w_flag |= WFHARD;
  313. X    wp->w_flag &= ~WFFORCE;
  314. X    return(TRUE);
  315. X}
  316. X
  317. X/*    updone:    update the current line    to the virtual screen        */
  318. X
  319. Xupdone(wp)
  320. X
  321. XWINDOW *wp;    /* window to update current line in */
  322. X
  323. X{
  324. X    register LINE *lp;    /* line to update */
  325. X    register int sline;    /* physical screen line to update */
  326. X    register int i;
  327. X
  328. X    /* search down the line we want */
  329. X    lp = wp->w_linep;
  330. X    sline = wp->w_toprow;
  331. X    while (lp != wp->w_dotp) {
  332. X        ++sline;
  333. X        lp = lforw(lp);
  334. X    }
  335. X
  336. X    /* and update the virtual line */
  337. X    vscreen[sline]->v_flag |= VFCHG;
  338. X    vscreen[sline]->v_flag &= ~VFREQ;
  339. X    vtmove(sline, 0);
  340. X    for (i=0; i < llength(lp); ++i)
  341. X        vtputc(lgetc(lp, i));
  342. X#if    COLOR
  343. X    vscreen[sline]->v_rfcolor = wp->w_fcolor;
  344. X    vscreen[sline]->v_rbcolor = wp->w_bcolor;
  345. X#endif
  346. X    vteeol();
  347. X}
  348. X
  349. X/*    updall:    update all the lines in a window on the virtual screen */
  350. X
  351. Xupdall(wp)
  352. X
  353. XWINDOW *wp;    /* window to update lines in */
  354. X
  355. X{
  356. X    register LINE *lp;    /* line to update */
  357. X    register int sline;    /* physical screen line to update */
  358. X    register int i;
  359. X
  360. X    /* search down the lines, updating them */
  361. X    lp = wp->w_linep;
  362. X    sline = wp->w_toprow;
  363. X    while (sline < wp->w_toprow + wp->w_ntrows) {
  364. X
  365. X        /* and update the virtual line */
  366. X        vscreen[sline]->v_flag |= VFCHG;
  367. X        vscreen[sline]->v_flag &= ~VFREQ;
  368. X        vtmove(sline, 0);
  369. X        if (lp != wp->w_bufp->b_linep) {
  370. X            /* if we are not at the end */
  371. X            for (i=0; i < llength(lp); ++i)
  372. X                vtputc(lgetc(lp, i));
  373. X            lp = lforw(lp);
  374. X        }
  375. X
  376. X        /* on to the next one */
  377. X#if    COLOR
  378. X        vscreen[sline]->v_rfcolor = wp->w_fcolor;
  379. X        vscreen[sline]->v_rbcolor = wp->w_bcolor;
  380. X#endif
  381. X        vteeol();
  382. X        ++sline;
  383. X    }
  384. X
  385. X}
  386. X
  387. X/*    updpos:    update the position of the hardware cursor and handle extended
  388. X        lines. This is the only update for simple moves.    */
  389. X
  390. Xupdpos()
  391. X
  392. X{
  393. X    register LINE *lp;
  394. X    register int c;
  395. X    register int i;
  396. X
  397. X    /* find the current row */
  398. X    lp = curwp->w_linep;
  399. X    currow = curwp->w_toprow;
  400. X    while (lp != curwp->w_dotp) {
  401. X        ++currow;
  402. X        lp = lforw(lp);
  403. X    }
  404. X
  405. X    /* find the current column */
  406. X    curcol = 0;
  407. X    i = 0;
  408. X    while (i < curwp->w_doto) {
  409. X        c = lgetc(lp, i++);
  410. X        if (c == '\t')
  411. X            curcol |= 0x07;
  412. X        else
  413. X            if (c < 0x20 || c == 0x7f)
  414. X                ++curcol;
  415. X
  416. X        ++curcol;
  417. X    }
  418. X
  419. X    /* if extended, flag so and update the virtual line image */
  420. X    if (curcol >=  term.t_ncol - 1) {
  421. X        vscreen[currow]->v_flag |= (VFEXT | VFCHG);
  422. X        updext();
  423. X    } else
  424. X        lbound = 0;
  425. X}
  426. X
  427. X/*    upddex:    de-extend any line that derserves it        */
  428. X
  429. Xupddex()
  430. X
  431. X{
  432. X    register WINDOW *wp;
  433. X    register LINE *lp;
  434. X    register int i,j;
  435. X
  436. X    wp = wheadp;
  437. X
  438. X    while (wp != NULL) {
  439. X        lp = wp->w_linep;
  440. X        i = wp->w_toprow;
  441. X
  442. X        while (i < wp->w_toprow + wp->w_ntrows) {
  443. X            if (vscreen[i]->v_flag & VFEXT) {
  444. X                if ((wp != curwp) || (lp != wp->w_dotp) ||
  445. X                   (curcol < term.t_ncol - 1)) {
  446. X                    vtmove(i, 0);
  447. X                    for (j = 0; j < llength(lp); ++j)
  448. X                        vtputc(lgetc(lp, j));
  449. X                    vteeol();
  450. X
  451. X                    /* this line no longer is extended */
  452. X                    vscreen[i]->v_flag &= ~VFEXT;
  453. X                    vscreen[i]->v_flag |= VFCHG;
  454. X                }
  455. X            }
  456. X            lp = lforw(lp);
  457. X            ++i;
  458. X        }
  459. X        /* and onward to the next window */
  460. X        wp = wp->w_wndp;
  461. X    }
  462. X}
  463. X
  464. X/*    updgar:    if the screen is garbage, clear the physical screen and
  465. X        the virtual screen and force a full update        */
  466. X
  467. Xupdgar()
  468. X
  469. X{
  470. X    register char *txt;
  471. X    register int i,j;
  472. X
  473. X    for (i = 0; i < term.t_nrow; ++i) {
  474. X        vscreen[i]->v_flag |= VFCHG;
  475. X#if    REVSTA
  476. X        vscreen[i]->v_flag &= ~VFREV;
  477. X#endif
  478. X#if    COLOR
  479. X        vscreen[i]->v_fcolor = gfcolor;
  480. X        vscreen[i]->v_bcolor = gbcolor;
  481. X#endif
  482. X#if    MEMMAP == 0
  483. X        txt = pscreen[i]->v_text;
  484. X        for (j = 0; j < term.t_ncol; ++j)
  485. X            txt[j] = ' ';
  486. X#endif
  487. X    }
  488. X
  489. X    movecursor(0, 0);         /* Erase the screen. */
  490. X    (*term.t_eeop)();
  491. X    sgarbf = FALSE;             /* Erase-page clears */
  492. X    mpresf = FALSE;             /* the message area. */
  493. X#if    COLOR
  494. X    mlerase();            /* needs to be cleared if colored */
  495. X#endif
  496. X}
  497. X
  498. X/*    updupd:    update the physical screen from the virtual screen    */
  499. X
  500. Xupdupd(force)
  501. X
  502. Xint force;    /* forced update flag */
  503. X
  504. X{
  505. X    register VIDEO *vp1;
  506. X    register int i;
  507. X
  508. X    for (i = 0; i < term.t_nrow; ++i) {
  509. X        vp1 = vscreen[i];
  510. X
  511. X        /* for each line that needs to be updated*/
  512. X        if ((vp1->v_flag & VFCHG) != 0) {
  513. X#if    TYPEAH
  514. X            if (force == FALSE && typahead())
  515. X                return(TRUE);
  516. X#endif
  517. X#if    MEMMAP
  518. X            updateline(i, vp1);
  519. X#else
  520. X            updateline(i, vp1, pscreen[i]);
  521. X#endif
  522. X        }
  523. X    }
  524. X    return(TRUE);
  525. X}
  526. X
  527. X/*    updext: update the extended line which the cursor is currently
  528. X        on at a column greater than the terminal width. The line
  529. X        will be scrolled right or left to let the user see where
  530. X        the cursor is
  531. X                                */
  532. X
  533. Xupdext()
  534. X
  535. X{
  536. X    register int rcursor;    /* real cursor location */
  537. X    register LINE *lp;    /* pointer to current line */
  538. X    register int j;        /* index into line */
  539. X
  540. X    /* calculate what column the real cursor will end up in */
  541. X    rcursor = ((curcol - term.t_ncol) % term.t_scrsiz) + term.t_margin;
  542. X    taboff = lbound = curcol - rcursor + 1;
  543. X
  544. X    /* scan through the line outputing characters to the virtual screen */
  545. X    /* once we reach the left edge                    */
  546. X    vtmove(currow, -lbound);    /* start scanning offscreen */
  547. X    lp = curwp->w_dotp;        /* line to output */
  548. X    for (j=0; j<llength(lp); ++j)    /* until the end-of-line */
  549. X        vtputc(lgetc(lp, j));
  550. X
  551. X    /* truncate the virtual line, restore tab offset */
  552. X    vteeol();
  553. X    taboff = 0;
  554. X
  555. X    /* and put a '$' in column 1 */
  556. X    vscreen[currow]->v_text[0] = '$';
  557. X}
  558. X
  559. X/*
  560. X * Update a single line. This does not know how to use insert or delete
  561. X * character sequences; we are using VT52 functionality. Update the physical
  562. X * row and column variables. It does try an exploit erase to end of line. The
  563. X * RAINBOW version of this routine uses fast video.
  564. X */
  565. X#if    MEMMAP
  566. X/*    UPDATELINE specific code for the IBM-PC and other compatables */
  567. X
  568. Xupdateline(row, vp1)
  569. X
  570. Xint row;        /* row of screen to update */
  571. Xstruct VIDEO *vp1;    /* virtual screen image */
  572. X
  573. X{
  574. X#if    COLOR
  575. X    scwrite(row, vp1->v_text, vp1->v_rfcolor, vp1->v_rbcolor);
  576. X    vp1->v_fcolor = vp1->v_rfcolor;
  577. X    vp1->v_bcolor = vp1->v_rbcolor;
  578. X#else
  579. X    if (vp1->v_flag & VFREQ)
  580. X        scwrite(row, vp1->v_text, 0, 7);
  581. X    else
  582. X        scwrite(row, vp1->v_text, 7, 0);
  583. X#endif
  584. X    vp1->v_flag &= ~(VFCHG | VFCOL);    /* flag this line as changed */
  585. X
  586. X}
  587. X
  588. X#else
  589. X
  590. Xupdateline(row, vp1, vp2)
  591. X
  592. Xint row;        /* row of screen to update */
  593. Xstruct VIDEO *vp1;    /* virtual screen image */
  594. Xstruct VIDEO *vp2;    /* physical screen image */
  595. X
  596. X{
  597. X#if RAINBOW
  598. X/*    UPDATELINE specific code for the DEC rainbow 100 micro    */
  599. X
  600. X    register char *cp1;
  601. X    register char *cp2;
  602. X    register int nch;
  603. X
  604. X    /* since we don't know how to make the rainbow do this, turn it off */
  605. X    flags &= (~VFREV & ~VFREQ);
  606. X
  607. X    cp1 = &vp1->v_text[0];                    /* Use fast video. */
  608. X    cp2 = &vp2->v_text[0];
  609. X    putline(row+1, 1, cp1);
  610. X    nch = term.t_ncol;
  611. X
  612. X    do
  613. X        {
  614. X        *cp2 = *cp1;
  615. X        ++cp2;
  616. X        ++cp1;
  617. X        }
  618. X    while (--nch);
  619. X    *flags &= ~VFCHG;
  620. X#else
  621. X/*    UPDATELINE code for all other versions        */
  622. X
  623. X    register char *cp1;
  624. X    register char *cp2;
  625. X    register char *cp3;
  626. X    register char *cp4;
  627. X    register char *cp5;
  628. X    register int nbflag;    /* non-blanks to the right flag? */
  629. X    int rev;        /* reverse video flag */
  630. X    int req;        /* reverse video request flag */
  631. X
  632. X
  633. X    /* set up pointers to virtual and physical lines */
  634. X    cp1 = &vp1->v_text[0];
  635. X    cp2 = &vp2->v_text[0];
  636. X
  637. X#if    COLOR
  638. X    TTforg(vp1->v_rfcolor);
  639. X    TTbacg(vp1->v_rbcolor);
  640. X#endif
  641. X
  642. X#if    REVSTA | COLOR
  643. X    /* if we need to change the reverse video status of the
  644. X       current line, we need to re-write the entire line     */
  645. X    rev = (vp1->v_flag & VFREV) == VFREV;
  646. X    req = (vp1->v_flag & VFREQ) == VFREQ;
  647. X    if ((rev != req)
  648. X#if    COLOR
  649. X        || (vp1->v_fcolor != vp1->v_rfcolor) || (vp1->v_bcolor != vp1->v_rbcolor)
  650. X#endif
  651. X#if    HP150
  652. X    /* the HP150 has some reverse video problems */
  653. X        || req || rev
  654. X#endif
  655. X            ) {
  656. X        movecursor(row, 0);    /* Go to start of line. */
  657. X        /* set rev video if needed */
  658. X        if (rev != req)
  659. X            (*term.t_rev)(req);
  660. X
  661. X        /* scan through the line and dump it to the screen and
  662. X           the virtual screen array                */
  663. X        cp3 = &vp1->v_text[term.t_ncol];
  664. X        while (cp1 < cp3) {
  665. X            TTputc(*cp1);
  666. X            ++ttcol;
  667. X            *cp2++ = *cp1++;
  668. X        }
  669. X        /* turn rev video off */
  670. X        if (rev != req)
  671. X            (*term.t_rev)(FALSE);
  672. X
  673. X        /* update the needed flags */
  674. X        vp1->v_flag &= ~VFCHG;
  675. X        if (req)
  676. X            vp1->v_flag |= VFREV;
  677. X        else
  678. X            vp1->v_flag &= ~VFREV;
  679. X#if    COLOR
  680. X        vp1->v_fcolor = vp1->v_rfcolor;
  681. X        vp1->v_bcolor = vp1->v_rbcolor;
  682. X#endif
  683. X        return(TRUE);
  684. X    }
  685. X#endif
  686. X
  687. X    /* advance past any common chars at the left */
  688. X    while (cp1 != &vp1->v_text[term.t_ncol] && cp1[0] == cp2[0]) {
  689. X        ++cp1;
  690. X        ++cp2;
  691. X    }
  692. X
  693. X/* This can still happen, even though we only call this routine on changed
  694. X * lines. A hard update is always done when a line splits, a massive
  695. X * change is done, or a buffer is displayed twice. This optimizes out most
  696. X * of the excess updating. A lot of computes are used, but these tend to
  697. X * be hard operations that do a lot of update, so I don't really care.
  698. X */
  699. X    /* if both lines are the same, no update needs to be done */
  700. X    if (cp1 == &vp1->v_text[term.t_ncol]) {
  701. X         vp1->v_flag &= ~VFCHG;        /* flag this line is changed */
  702. X        return(TRUE);
  703. X    }
  704. X
  705. X    /* find out if there is a match on the right */
  706. X    nbflag = FALSE;
  707. X    cp3 = &vp1->v_text[term.t_ncol];
  708. X    cp4 = &vp2->v_text[term.t_ncol];
  709. X
  710. X    while (cp3[-1] == cp4[-1]) {
  711. X        --cp3;
  712. X        --cp4;
  713. X        if (cp3[0] != ' ')        /* Note if any nonblank */
  714. X            nbflag = TRUE;        /* in right match. */
  715. X    }
  716. X
  717. X    cp5 = cp3;
  718. X
  719. X    /* Erase to EOL ? */
  720. X    if (nbflag == FALSE && eolexist == TRUE && (req != TRUE)) {
  721. X        while (cp5!=cp1 && cp5[-1]==' ')
  722. X            --cp5;
  723. X
  724. X        if (cp3-cp5 <= 3)        /* Use only if erase is */
  725. X            cp5 = cp3;        /* fewer characters. */
  726. X    }
  727. X
  728. X    movecursor(row, cp1 - &vp1->v_text[0]);    /* Go to start of line. */
  729. X#if    REVSTA
  730. X    TTrev(rev);
  731. X#endif
  732. X
  733. X    while (cp1 != cp5) {        /* Ordinary. */
  734. X        TTputc(*cp1);
  735. X        ++ttcol;
  736. X        *cp2++ = *cp1++;
  737. X    }
  738. X
  739. X    if (cp5 != cp3) {        /* Erase. */
  740. X        TTeeol();
  741. X        while (cp1 != cp3)
  742. X            *cp2++ = *cp1++;
  743. X    }
  744. X#if    REVSTA
  745. X    TTrev(FALSE);
  746. X#endif
  747. X    vp1->v_flag &= ~VFCHG;        /* flag this line as updated */
  748. X    return(TRUE);
  749. X#endif
  750. X}
  751. X#endif
  752. X
  753. X/*
  754. X * Redisplay the mode line for the window pointed to by the "wp". This is the
  755. X * only routine that has any idea of how the modeline is formatted. You can
  756. X * change the modeline format by hacking at this routine. Called by "update"
  757. X * any time there is a dirty window.
  758. X */
  759. Xmodeline(wp)
  760. X    WINDOW *wp;
  761. X{
  762. X    register char *cp;
  763. X    register int c;
  764. X    register int n;        /* cursor position count */
  765. X    register BUFFER *bp;
  766. X    register i;            /* loop index */
  767. X    register lchar;        /* character to draw line in buffer with */
  768. X    register firstm;        /* is this the first mode? */
  769. X    char tline[NLINE];        /* buffer for part of mode line */
  770. X
  771. X    n = wp->w_toprow+wp->w_ntrows;          /* Location. */
  772. X    vscreen[n]->v_flag |= VFCHG | VFREQ | VFCOL;/* Redraw next time. */
  773. X#if    COLOR
  774. X    vscreen[n]->v_rfcolor = 0;            /* black on */
  775. X    vscreen[n]->v_rbcolor = 7;            /* white.....*/
  776. X#endif
  777. X    vtmove(n, 0);                           /* Seek to right line. */
  778. X    if (wp == curwp)                /* mark the current buffer */
  779. X    lchar = '=';
  780. X    else
  781. X#if    REVSTA
  782. X    if (revexist)
  783. X        lchar = ' ';
  784. X    else
  785. X#endif
  786. X        lchar = '-';
  787. X
  788. X    vtputc(lchar);
  789. X    bp = wp->w_bufp;
  790. X
  791. X    if ((bp->b_flag&BFCHG) != 0)                /* "*" if changed. */
  792. X        vtputc('*');
  793. X    else
  794. X        vtputc(lchaX
  795. X    n  = 2;
  796. X    strcpy(tline, " MicroEMACS ");        /* Buffer name. */
  797. X    strcat(tline, VERSION);
  798. X    strcat(tline, " (");
  799. X
  800. X    /* display the modes */
  801. X
  802. X    firstm = TRUE;
  803. X    for (i = 0; i < NUMMODES; i++)    /* add in the mode flags */
  804. X        if (wp->w_bufp->b_mode & (1 << i)) {
  805. X            if (firstm != TRUE)
  806. X                strcat(tline, " ");
  807. X            firstm = FALSE;
  808. X            strcat(tline, modename[i]);
  809. X        }
  810. X    strcat(tline,") ");
  811. X
  812. X    cp = &tline[0];
  813. X    while ((c = *cp++) != 0)
  814. X        {
  815. X        vtputc(c);
  816. X        ++n;
  817. X        }
  818. X
  819. X#if 0
  820. X    vtputc(lchar);
  821. X    vtputc((wp->w_flag&WFCOLR) != 0  ? 'C' : lchar);
  822. X    vtputc((wp->w_flag&WFMODE) != 0  ? 'M' : lchar);
  823. X    vtputc((wp->w_flag&WFHARD) != 0  ? 'H' : lchar);
  824. X    vtputc((wp->w_flag&WFEDIT) != 0  ? 'E' : lchar);
  825. X    vtputc((wp->w_flag&WFMOVE) != 0  ? 'V' : lchar);
  826. X    vtputc((wp->w_flag&WFFORCE) != 0 ? 'F' : lchar);
  827. X    vtputc(lchar);
  828. X    n += 8;
  829. X#endif
  830. X
  831. X    vtputc(lchar);
  832. X    vtputc(lchar);
  833. X    vtputc(' ');
  834. X    n += 3;
  835. X    cp = &bp->b_bname[0];
  836. X
  837. X    while ((c = *cp++) != 0)
  838. X        {
  839. X        vtputc(c);
  840. X        ++n;
  841. X        }
  842. X
  843. X    vtputc(' ');
  844. X    vtputc(lchar);
  845. X    vtputc(lchar);
  846. X    n += 3;
  847. X
  848. X    if (bp->b_fname[0] != 0)            /* File name. */
  849. X        {
  850. X    vtputc(' ');
  851. X    ++n;
  852. X        cp = "File: ";
  853. X
  854. X        while ((c = *cp++) != 0)
  855. X            {
  856. X            vtputc(c);
  857. X            ++n;
  858. X            }
  859. X
  860. X        cp = &bp->b_fname[0];
  861. X
  862. X        while ((c = *cp++) != 0)
  863. X            {
  864. X            vtputc(c);
  865. X            ++n;
  866. X            }
  867. X
  868. X        vtputc(' ');
  869. X        ++n;
  870. X        }
  871. X
  872. X    while (n < term.t_ncol)             /* Pad to full width. */
  873. X        {
  874. X        vtputc(lchar);
  875. X        ++n;
  876. X        }
  877. X}
  878. X
  879. Xupmode()    /* update all the mode lines */
  880. X
  881. X{
  882. X    register WINDOW *wp;
  883. X
  884. X    wp = wheadp;
  885. X    while (wp != NULL) {
  886. X        wp->w_flag |= WFMODE;
  887. X        wp = wp->w_wndp;
  888. X    }
  889. X}
  890. X
  891. X/*
  892. X * Send a command to the terminal to move the hardware cursor to row "row"
  893. X * and column "col". The row and column arguments are origin 0. Optimize out
  894. X * random calls. Update "ttrow" and "ttcol".
  895. X */
  896. Xmovecursor(row, col)
  897. X    {
  898. X    if (row!=ttrow || col!=ttcol)
  899. X        {
  900. X        ttrow = row;
  901. X        ttcol = col;
  902. X        TTmove(row, col);
  903. X        }
  904. X    }
  905. X
  906. X/*
  907. X * Erase the message line. This is a special routine because the message line
  908. X * is not considered to be part of the virtual screen. It always works
  909. X * immediately; the terminal buffer is flushed via a call to the flusher.
  910. X */
  911. Xmlerase()
  912. X    {
  913. X    int i;
  914. X    
  915. X    movecursor(term.t_nrow, 0);
  916. X#if    COLOR
  917. X     TTforg(7);
  918. X     TTbacg(0);
  919. X#endif
  920. X    if (eolexist == TRUE)
  921. X        TTeeol();
  922. X    else {
  923. X        for (i = 0; i < term.t_ncol - 1; i++)
  924. X            TTputc(' ');
  925. X        movecursor(term.t_nrow, 1);    /* force the move! */
  926. X        movecursor(term.t_nrow, 0);
  927. X    }
  928. X    TTflush();
  929. X    mpresf = FALSE;
  930. X    }
  931. X
  932. X/*
  933. X * Write a message into the message line. Keep track of the physical cursor
  934. X * position. A small class of printf like format items is handled. Assumes the
  935. X * stack grows down; this assumption is made by the "++" in the argument scan
  936. X * loop. Set the "message line" flag TRUE.
  937. X */
  938. X
  939. Xmlwrite(fmt, arg)
  940. X    char *fmt;
  941. X    {
  942. X    register int c;
  943. X    register char *ap;
  944. X
  945. X#if    COLOR
  946. X    TTforg(7);
  947. X    TTbacg(0);
  948. X#endif
  949. X    if (eolexist == FALSE) {
  950. X        mlerase();
  951. X        TTflush();
  952. X    }
  953. X
  954. X    movecursor(term.t_nrow, 0);
  955. X    ap = (char *) &arg;
  956. X    while ((c = *fmt++) != 0) {
  957. X        if (c != '%') {
  958. X            TTputc(c);
  959. X            ++ttcol;
  960. X            }
  961. X        else
  962. X            {
  963. X            c = *fmt++;
  964. X            switch (c) {
  965. X                case 'd':
  966. X                    mlputi(*(int *)ap, 10);
  967. X                    ap += sizeof(int);
  968. X                    break;
  969. X
  970. X                case 'o':
  971. X                    mlputi(*(int *)ap,  8);
  972. X                    ap += sizeof(int);
  973. X                    break;
  974. X
  975. X                case 'x':
  976. X                    mlputi(*(int *)ap, 16);
  977. X                    ap += sizeof(int);
  978. X                    break;
  979. X
  980. X                case 'D':
  981. X                    mlputli(*(long *)ap, 10);
  982. X                    ap += sizeof(long);
  983. X                    break;
  984. X
  985. X                case 's':
  986. X                    mlputs(*(char **)ap);
  987. X                    ap += sizeof(char *);
  988. X                    break;
  989. X
  990. X        case 'f':
  991. X            mlputf(*(int *)ap);
  992. X            ap += sizeof(int);
  993. X            break;
  994. X
  995. X                default:
  996. X                    TTputc(c);
  997. X                    ++ttcol;
  998. X                }
  999. X            }
  1000. X        }
  1001. X    if (eolexist == TRUE)
  1002. X        TTeeol();
  1003. X    TTflush();
  1004. X    mpresf = TRUE;
  1005. X    }
  1006. X
  1007. X/*
  1008. X * Write out a string. Update the physical cursor position. This assumes that
  1009. X * the characters in the string all have width "1"; if this is not the case
  1010. X * things will get screwed up a little.
  1011. X */
  1012. Xmlputs(s)
  1013. X    char *s;
  1014. X    {
  1015. X    register int c;
  1016. X
  1017. X    while ((c = *s++) != 0)
  1018. X        {
  1019. X        TTputc(c);
  1020. X        ++ttcol;
  1021. X        }
  1022. X    }
  1023. X
  1024. X/*
  1025. X * Write out an integer, in the specified radix. Update the physical cursor
  1026. X * position.
  1027. X */
  1028. Xmlputi(i, r)
  1029. X    {
  1030. X    register int q;
  1031. X    static char hexdigits[] = "0123456789ABCDEF";
  1032. X
  1033. X    if (i < 0)
  1034. X        {
  1035. X        i = -i;
  1036. X        TTputc('-');
  1037. X        }
  1038. X
  1039. X    q = i/r;
  1040. X
  1041. X    if (q != 0)
  1042. X        mlputi(q, r);
  1043. X
  1044. X    TTputc(hexdigits[i%r]);
  1045. X    ++ttcol;
  1046. X    }
  1047. X
  1048. X/*
  1049. X * do the same except as a long integer.
  1050. X */
  1051. Xmlputli(l, r)
  1052. X    long l;
  1053. X    {
  1054. X    register long q;
  1055. X
  1056. X    if (l < 0)
  1057. X        {
  1058. X        l = -l;
  1059. X        TTputc('-');
  1060. X        }
  1061. X
  1062. X    q = l/r;
  1063. X
  1064. X    if (q != 0)
  1065. X        mlputli(q, r);
  1066. X
  1067. X    TTputc((int)(l%r)+'0');
  1068. X    ++ttcol;
  1069. X    }
  1070. X
  1071. X/*
  1072. X *    write out a scaled integer with two decimal places
  1073. X */
  1074. X
  1075. Xmlputf(s)
  1076. X
  1077. Xint s;    /* scaled integer to output */
  1078. X
  1079. X{
  1080. X    int i;    /* integer portion of number */
  1081. X    int f;    /* fractional portion of number */
  1082. X
  1083. X    /* break it up */
  1084. X    i = s / 100;
  1085. X    f = s % 100;
  1086. X
  1087. X    /* send out the integer portion */
  1088. X    mlputi(i, 10);
  1089. X    TTputc('.');
  1090. X    TTputc((f / 10) + '0');
  1091. X    TTputc((f % 10) + '0');
  1092. X    ttcol += 3;
  1093. X}    
  1094. X
  1095. X#if RAINBOW
  1096. X
  1097. Xputline(row, col, buf)
  1098. X    int row, col;
  1099. X    char buf[];
  1100. X    {
  1101. X    int n;
  1102. X
  1103. X    n = strlen(buf);
  1104. X    if (col + n - 1 > term.t_ncol)
  1105. X        n = term.t_ncol - col + 1;
  1106. X    Put_Data(row, col, n, buf);
  1107. X    }
  1108. X#endif
  1109. X
  1110. END_OF_display.c
  1111. if test 23826 -ne `wc -c <display.c`; then
  1112.     echo shar: \"display.c\" unpacked with wrong size!
  1113. fi
  1114. # end of overwriting check
  1115. fi
  1116. echo shar: Extracting \"emacs.tut\" \(29549 characters\)
  1117. if test -f emacs.tut ; then 
  1118.   echo shar: Will not over-write existing file \"emacs.tut\"
  1119. else
  1120. sed "s/^X//" >emacs.tut <<'END_OF_emacs.tut'
  1121. XYou are looking at the MicroEMACS tutorial.  Comments on this document may
  1122. Xbe referred to Daniel Lawrance.
  1123. X
  1124. XNOTE:  This tutorial attempts to help you "learn by doing".  The characters
  1125. X       ">>" at the left margin of your screen indicate directions for you to
  1126. X       try using a command.
  1127. X
  1128. XEMACS commands generally involve the CONTROL key (sometimes labelled CTRL
  1129. Xor CTL) or the META key (generally labelled ESCAPE).  Rather than write out
  1130. XCONTROL or META each time we want you to prefix a character, we'll use the
  1131. Xfollowing abbreviations:
  1132. X
  1133. X   ^<chr>    Hold the CONTROL key while pressing the character <chr>.
  1134. X             Thus, ^F would be:  hold the CONTROL key and press F.
  1135. X
  1136. X>>  Now type ^V (View Next Screen) to move to the next screen.
  1137. X    Remember:  hold the CONTROL key and press V.
  1138. X
  1139. X   ESC-<chr>  Press the ESCAPE key and release it, then press the
  1140. X              character <chr>.  Note:  The command will have the
  1141. X              same meaning for upper or lower case characters (<chr>).
  1142. X
  1143. XIMPORTANT NOTE:  If you must exit at some point, type ^X^C.
  1144. X
  1145. XFor the time being, you'll be expected to type ^V whenever you finish reading
  1146. Xthe current screen.
  1147. X
  1148. XNote that there is an overlap when going from screen to screen; this provides
  1149. Xsome continuity when moving through the file.
  1150. X
  1151. XThe first thing that you need to know is how to move around from place to
  1152. Xplace in the file.  You already know how to move forward a screen with ^V.
  1153. XTo move back a screen, type ^Z.
  1154. X
  1155. X>>  Try typing ^Z and then ^V to move back and forth between screens a few
  1156. X    times.
  1157. X
  1158. X
  1159. XSUMMARY
  1160. X-------
  1161. X
  1162. XThe following commands are useful for viewing screens:
  1163. X
  1164. X     ^V       Move forward one screen
  1165. X     ^Z       Move back one screen
  1166. X     ESC-^L   Clear screen and redisplay everything, putting the text
  1167. X              near the cursor at the center of the screen.
  1168. X
  1169. X>>  Find the cursor and remember what text is near it.  Type an ESC-^L.
  1170. X    Find the cursor again and see what text is near it now.
  1171. X
  1172. X
  1173. XBASIC CURSOR CONTROL
  1174. X--------------------
  1175. X
  1176. XGetting from screen to screen is useful, but how do you reposition yourself
  1177. Xwithin a given screen to a specific place?  There are several ways you can
  1178. Xdo this.  One way (not the best, but the most basic) is to use the commands
  1179. Xprevious, backward, forward and next.  As you can imagine these commands
  1180. X(which are given to EMACS as ^P, ^B, ^F, and ^N  respectively) move the
  1181. Xcursor from where it currently is to a new place in the given direction.
  1182. XHere, in a more graphical form, are the commands:
  1183. X
  1184. X                          Previous line, ^P
  1185. X                                  :
  1186. X                                  :
  1187. X   Backward, ^B .... Current cursor position .... Forward, ^F
  1188. X                                  :
  1189. X                                  :
  1190. X                          Next line, ^N
  1191. X
  1192. XYou'll probably find it easy to think of these by letter.  P for previous,
  1193. XN for next, B for backward and F for forward.  These are the basic cursor
  1194. Xpositioning commands and you'll be using them ALL the time so it would be
  1195. Xof great benefit if you learn them now.
  1196. X
  1197. X>>  Do a few ^N's to bring the cursor down to this line.
  1198. X
  1199. X>>  Move into the line with ^F's and then up with several ^P's.  Note what
  1200. X    ^P does when the cursor is in the middle of the line.
  1201. X
  1202. X>>  Try ^B at the beginning of a line.  Note what happened to the cursor.
  1203. X    Do a few more ^B's.  Then do ^F's back to the end of the line and beyond.
  1204. X
  1205. XWhen you go off the top or bottom of the screen, the text beyond the edge is
  1206. Xshifted onto the screen so that your instructions can be carried out while
  1207. Xkeeping the cursor on the screen.
  1208. X
  1209. X>>  Move the cursor off the bottom of the screen with ^N's and see what
  1210. X    happens.  Note the new position of the cursor.
  1211. X
  1212. XIf moving by characters is too slow, you can move by words.  ESC-F moves
  1213. Xforward a word and ESC-B moves back a word.
  1214. X
  1215. X>>  Type a few ESC-F's and ESC-B's.  Intersperse them with ^F's and ^B's.
  1216. X
  1217. XNotice the parallel between ^F and ^B on the one hand, and ESC-F and ESC-B on
  1218. Xthe other hand.  Very often META characters are used for operations related
  1219. Xto English text whereas CONTROL characters operate on the basic textual units
  1220. Xthat are independent of what you are editing (characters, lines, etc.).
  1221. X
  1222. XTwo other commands which are useful are ^A and ^E.  These commands move the
  1223. Xcursor to the beginning (^A) and the end (^E) of the line.
  1224. X
  1225. X>>  Try a couple of ^A's, and then a couple of ^E's.  Note that the cursor
  1226. X    does not move when either of these commands is repeated continuously.
  1227. X
  1228. XTwo other simple cursor motion commands are ESC-< (less than), which moves
  1229. Xto the beginning of the file, and ESC-> (greater than), which moves to the
  1230. Xend of the file.  If you need the shift key to type a "<", then you must
  1231. Xalso use the shift key to type ESC-<.  Otherwise, you would be typing ESC-, .
  1232. X
  1233. XThe location of the cursor within the text is also called "point".  To
  1234. Xparaphrase, the cursor shows on the screen where point is located in the
  1235. Xtext.
  1236. X
  1237. XHere is a summary of simple moving operations, including the word and
  1238. Xline moving commands:
  1239. X
  1240. X     ^F        Move forward a character
  1241. X     ^B        Move back a character
  1242. X
  1243. X     ESC-F     Move forward a word
  1244. X     ESC-B     Move back a word
  1245. X
  1246. X     ^N        Move to next line
  1247. X     ^P        Move to previous line
  1248. X
  1249. X     ESC-N     Move to next paragraph
  1250. X     ESC-P     Move to previous paragraph
  1251. X
  1252. X     ^A        Move to beginning of line
  1253. X     ^E        Move to end of line
  1254. X
  1255. X     ESC-<     Go to beginning of file
  1256. X     ESC->     Go to end of file
  1257. X
  1258. X>>  Try all of these commands now a few times for practice as these are
  1259. X    the most often used commands.  Since the last two will take you away
  1260. X    from this screen, use ^V's and ^Z's to return here.
  1261. X
  1262. XLike all other commands in EMACS, these commands can be given arguments
  1263. Xwhich cause them to be executed repeatedly.  The way you give a command
  1264. Xa repeat count is by pressing META (ESC) and then the number before you
  1265. Xenter the command.  As a special case, typing ^U is equivalent to ESC-4.
  1266. X
  1267. XFor instance, ESC-8 ^F moves forward eight characters.
  1268. X
  1269. X>>  Try giving a suitable argument to ^N or ^P to come as close as you
  1270. X    can to this line in one jump.
  1271. X
  1272. XThis also applies to the screen moving commands, ^V and ^Z.  When given
  1273. Xan argument, they scroll the screen up or down by that many screens.
  1274. X
  1275. X>>  Try typing ESC-3 ^V now.
  1276. X
  1277. XIf you would like to scroll up, you can give an argument to ^Z.
  1278. X
  1279. X
  1280. XABORTING COMMANDS
  1281. X-----------------
  1282. X
  1283. XThe EMACS command used to abort any command which requests input is
  1284. X^G.  For example, you can use ^G to discard a numeric argument or at
  1285. Xthe beginning of a command that you don't want to finish.
  1286. X
  1287. X>>  Type ESC-100 to make a numeric argument of 100, then type ^G.
  1288. X    Now type ^F.  How many characters does it move?  If you have
  1289. X    typed an ESC by mistake, you can get rid of it with ^G^G.
  1290. X
  1291. X
  1292. XERRORS
  1293. X------
  1294. XSometimes you may do something which EMACS doesn't allow.  If it is
  1295. Xsomething simple, such as typing a CONTROL key sequence which is not
  1296. Xassociated with any command, EMACS will just beep at you.  Otherwise,
  1297. XEMACS will also display an informative error message at the bottom of
  1298. Xthe screen.
  1299. X
  1300. XSome versions of EMACS do not have all the features described in this
  1301. Xtutorial implemented yet.  If you come across such an unimplemented
  1302. Xfeature, you may get an error message when you try to use it.  Just
  1303. Xpress any cursor movement key and proceed to the next section of the
  1304. Xtutorial.
  1305. X
  1306. X
  1307. XNOTE:  Several of the exercises in the following sections allow you to use
  1308. X       options which will make changes to this tutorial. Do no worry about
  1309. X       these changes affecting the tutorial - this is only a copy of the
  1310. X       master tutorial and you will not be instructed to save the changes
  1311. X       made to it.
  1312. X
  1313. X
  1314. XCURSOR KEYS
  1315. X-----------
  1316. X
  1317. XThe cursor keypad, usually located on the right side of the keyboard,
  1318. Xhas been bound to some of the more useful screen movement commands.
  1319. XThe mappings are as follows:
  1320. X
  1321. X     Cursor-Right    ^F        Move forward a character
  1322. X     Cursor-Left     ^B        Move back a character
  1323. X
  1324. X
  1325. X     ^Cursor-Right   ESC-F     Move forward a word
  1326. X     ^Cursor-Left    ESC-B     Move back a word
  1327. X
  1328. X
  1329. X     Cursor-Down     ^N        Move to next line
  1330. X     Cursor-Up       ^P        Move to previous line
  1331. X
  1332. X
  1333. X     Pg-Dn           ^V        Move to next screen
  1334. X     Pg-Up           ^Z        Move to previous screen
  1335. X
  1336. X
  1337. X     Home            ESC-<     Go to beginning of file
  1338. X     End             ESC->     Go to end of file
  1339. X
  1340. X
  1341. X     Insert          ^C        Insert single space
  1342. X     Delete          ^D        Delete current character
  1343. X
  1344. XA map of the keypad layout looks something like this:
  1345. X
  1346. X                   -------------------------------------------------
  1347. X                   | 7             | 8             | 9             |
  1348. X                   | Home          | ^             | Pg Up         |
  1349. X                   |        ESC-<  | |         ^P  |           ^Z  |
  1350. X                   -------------------------------------------------
  1351. X                   | 4             | 5             | 6             |
  1352. X                   | <--       ^B  |               | -->       ^F  |
  1353. X                   -------------------------------------------------
  1354. X                   | 1             | 2             | 3             |
  1355. X                   | End           | |             | Pg Dn         |
  1356. X                   |        ESC->  | v         ^N  |           ^V  |
  1357. X       -------------------------------------------------------------
  1358. X       | 0                           | .                           |
  1359. X       | Insert                  ^C  | Delete                  ^D  |
  1360. X       -------------------------------------------------------------
  1361. X
  1362. X>>  Practice using the cursor keypad.
  1363. X
  1364. X
  1365. XMODE LINE
  1366. X---------
  1367. X
  1368. XThe line above the function key display at the bottom of the screen
  1369. Xis referred to as the "communication line".  This is where EMACS
  1370. Xinteractively communicates with you.  Later you will see how EMACS
  1371. Xprompts you for information on this line, such as to initiate a
  1372. Xsearch.  EMACS can report things to you on this line as well.
  1373. X
  1374. X>>  Type ^X= and see what appears in the communication line. Don't worry
  1375. X    about what all this information means - it is just an example of how
  1376. X    EMACS lets you know more about the file you are editing.
  1377. X
  1378. XThe line immediately above the communication line is referred to as the
  1379. X"mode line".  The mode line looks something like
  1380. X
  1381. X=* MicroEMACS 3.7 () == emacs.tut == File: emacs.tut ===========================
  1382. X
  1383. XThis is a very useful "information" line.
  1384. X
  1385. X  -  The asterisk (star) indicates that changes have been made to the file.
  1386. X     Immediately after opening or saving a file, there is no star.
  1387. X
  1388. X  -  Any words inside the parentheses indicate the "modes" EMACS is
  1389. X     currently in.  Modes will be discussed in the next section.
  1390. X
  1391. X  -  The string following the () is the buffername, i.e., the name EMACS
  1392. X     gives to the buffer, and it is usually related to the filename.
  1393. X
  1394. X  -  The string following "File:" is the name of the file you are
  1395. X     currently editing.
  1396. X
  1397. X>>  Look at the mode line and identify the items discussed above.
  1398. X
  1399. X
  1400. XMODES
  1401. X-----
  1402. X
  1403. XListed within the parentheses are the "modes" which are associated with
  1404. Xthe current buffer.  Modes are a feature of EMACS which assist in the
  1405. Xediting of different languages, i.e., C, and text.  Presently, there are
  1406. Xno modes associated with this buffer.  This means EMACS will do exactly
  1407. Xwhat you think it will when using it - no "bonuses".  You can find out
  1408. Xmore about the current buffer and mode status by typing ^X^B.  Refer to
  1409. Xthe EMACS manual for a further discussion of buffers and modes.
  1410. X
  1411. XAs you become more familiar with EMACS and the use of buffers, "mode"
  1412. Xtakes on additional meaning.  When more than one buffer is in use, a
  1413. Xmode is referred to as "local" or "global".  These terms indicate how a
  1414. Xmode will affect the current buffer and other existing or to be added
  1415. Xbuffers.
  1416. X
  1417. XA "local" mode is valid only within the scope of the current buffer.
  1418. XOther existing buffers and buffers which will be added are not affected
  1419. Xby local modes.
  1420. X
  1421. XThe commands to add and delete local modes are
  1422. X
  1423. X     ^XM       Add a local mode
  1424. X     ^X^M      Delete a local mode
  1425. X
  1426. XEach of the above commands will prompt you for a mode.  To activate
  1427. X(deactivate) a mode, type the name of a valid (active) mode (refer to
  1428. XEMACS manual for a complete list of the valid modes) and follow it by
  1429. Xpressing <Return>, the carriage-return key.
  1430. X
  1431. X>>  Type ^XM WRAP - note the change in the mode line.  Move the cursor
  1432. X    to a blank line on this screen and begin typing the sequence "asdf ".
  1433. X    Continue typing this sequence and note what happens when the right
  1434. X    margin is encountered.
  1435. X
  1436. XThe previous exercise allowed you to enter text with the "WRAP" mode
  1437. Xactive.  As you can see, "WRAP" instructs EMACS to break between words
  1438. Xwhen a line gets too long.  However, in order for this mode to be
  1439. Xeffective, spaces must be inserted between words.
  1440. X
  1441. XThe right margin is usually set at 72 characters but it can be changed.
  1442. XTo change the margin type ESC nn ^XF where "nn" is the column number of
  1443. Xthe new right-hand margin.
  1444. X
  1445. X>>  Type ESC 40 ^XF.  Then begin typing "asdf " and notice where the
  1446. X    line now breaks.  To return to the default right-hand margin, type
  1447. X    ESC 72 ^XF.
  1448. X
  1449. X>>  Type ^X^M WRAP to "turn off" the local mode "WRAP".
  1450. X
  1451. XA "global" mode affects only those buffers which will be ADDED after the
  1452. X"add/delete global mode" command is executed - not the current or other
  1453. Xexisting buffers.  Currently there is no global mode set.
  1454. X
  1455. XThe commands to add and delete global modes are
  1456. X
  1457. X     ESC-M     Add a global mode
  1458. X     ESC-^M    Delete a global mode
  1459. X
  1460. XNote:  All modes can be local.  However, global modes allow you to
  1461. X       activate those modes which usually apply to most of the buffers
  1462. X       in use.
  1463. X
  1464. XAs with local modes, each of the above commands will prompt you for
  1465. Xa mode.  To activate (deactivate) a mode, enter the name of a valid
  1466. X(active) mode.
  1467. X
  1468. X>>  Type ESC-M OVER.  This mode tells EMACS to write over the text on
  1469. X    the current line.  Is there any change in the mode line? Now move to
  1470. X    the line of "asdf " you entered and start typing.  Note that nothing
  1471. X    happens.  Remember that global modes affect only those modes which
  1472. X    will be added - not those already existing.
  1473. X
  1474. X>>  Type ESC-^M OVER to "turn off" the global overwrite mode.
  1475. X
  1476. X
  1477. XINSERTING AND DELETING
  1478. X----------------------
  1479. X
  1480. XIf you want to type text, just start typing.  Characters which you
  1481. Xcan see, such as A, 7, *, etc. are taken by EMACS as text and are
  1482. Ximmediately inserted.  Type <Return> to insert a line separator,
  1483. Xi.e., a single linefeed character.
  1484. X
  1485. XYou can delete the last character you typed by typing either <Delete>
  1486. Xor ^H.  On some keyboards, there is a dedicated key for creating a ^H.
  1487. XIf so, it is usually labelled as either "Backspace" or "<--".  <Delete>
  1488. Xis a key on the keyboard, which may be labelled "Rubout" instead of
  1489. X"Delete" on some terminals.  More generally, <Delete> deletes the
  1490. Xcharacter immediately before the current cursor position.
  1491. X
  1492. X>>  Now type a few characters and then delete them by typing <Delete>
  1493. X    a few times.
  1494. X
  1495. X>>  Now start typing text until you reach the right margin, then continue
  1496. X    to type.  When a line of text gets too big for one line on the screen,
  1497. X    the line of text is "continued" off the edge of the screen.  The dollar
  1498. X    sign at the right margin indicates a line which has been continued.
  1499. X    EMACS scrolls the line over so you can see what you are editing.  The
  1500. X    "$" at the left or right edge of the screen indicates that the current
  1501. X    line extends off in that direction.
  1502. X
  1503. XThis concept is easier to understand by doing rather than by reading about
  1504. Xit so it is suggested that the following exercises be done.
  1505. X
  1506. X>>  The following line actually goes off the edge.  Try typing enough ESC-F's
  1507. X    so that you move off the right hand end of this line.  This is a long line of text.  Note the "$" at each edge.  Keep typing ESC-F's and watch where EMACS decides to scroll the line.  Now, type ESC-B's until EMACS decides to scroll the line again.
  1508. X
  1509. X>>  Go to the line you entered which the text continued off the edge of
  1510. X    the screen.  Use ^D's to delete the text until the text line fits on
  1511. X    one screen line again.  The continuation "$" will go away.
  1512. X
  1513. X>>  Move the cursor to the beginning of a line and type <Delete>.  This
  1514. X    deletes the line separator before the line and merges the line onto
  1515. X    the previous line.  The resulting line may be too long to fit on the
  1516. X    screen, in which case it has a continuation indicator.
  1517. X
  1518. X>>  Press <Return> to insert the separator again.
  1519. X
  1520. XInternally, EMACS will allow you to have lines of nearly any length, limited
  1521. Xonly by the amount of memory available.  Externally, however, EMACS can only
  1522. Xread or write lines, to or from a file, which are less than or equal to 255
  1523. Xcharacters.
  1524. X
  1525. XRemember that most EMACS commands can be given a repeat count.  Note that
  1526. Xthis includes characters which insert themselves.
  1527. X
  1528. X>>  Try that now -- type ESC-8 * and see what happens.
  1529. X
  1530. XIf you want to insert spaces in a line, type ^C.
  1531. X
  1532. X>>  Move to a line and move the cursor with ^F's; then insert spaces with ^C.
  1533. X    Use ^D to remove the spaces.
  1534. X
  1535. XIf you want to create a blank line between two lines, move to the second
  1536. Xof the two lines and type ^O.
  1537. X
  1538. X>>  Try moving to a line and typing ^O now.
  1539. X
  1540. XYou've now learned the most basic way of typing something in EMACS and
  1541. Xcorrecting errors.  You can delete characters, words or lines as well.
  1542. XHere is a summary of the delete operations:
  1543. X
  1544. X     <Delete>      Delete the character just before the cursor
  1545. X     ^H            Delete the character just before the cursor
  1546. X     ^D            Delete the character the cursor is under
  1547. X
  1548. X     ESC-<Delete>  Kill the word immediately before the cursor
  1549. X     ESC-^H        Kill the word immediately before the cursor
  1550. X     ESC-D         Kill the word from the cursor position
  1551. X
  1552. X     ^K            Kill from the cursor position to end of line
  1553. X
  1554. XNotice that <Delete> and ^D vs ESC-<Delete> and ESC-D extend the parallel
  1555. Xstarted by ^F and ESC-F (well, <Delete> isn't really a control character,
  1556. Xbut let's not worry about that).
  1557. X
  1558. XNow suppose you kill something, and then you decide that you want to get
  1559. Xit back?  Well, whenever you kill something bigger than a character, EMACS
  1560. Xsaves it for you.  To yank it back, use ^Y.  Note that you don't have to
  1561. Xbe in the same place to do ^Y.  This is a good way to move text around.
  1562. XAlso note the difference between "Killing" and "Deleting" - "Killed" text
  1563. Xcan be yanked back, and "Deleted" text cannot.  Generally, the commands
  1564. Xthat can destroy a lot of text save it, while the ones that attack only
  1565. Xone character do not save it.
  1566. X
  1567. X>>  Type ^N a couple times to position the cursor at some line on this
  1568. X    screen.  Now kill that line with ^K.
  1569. X
  1570. XNote that a single ^K kills the contents of the line, and a second ^K
  1571. Xkills the line itself, and makes all the other lines move up.  If you
  1572. Xgive ^K a repeat count, it kills that many lines AND their contents.
  1573. X
  1574. XThe text that has just disappeared is saved so that you can retrieve it.
  1575. XTo retrieve the last killed text and put it where the cursor currently
  1576. Xis, type ^Y.
  1577. X
  1578. X>>  Try it.  Type ^Y to yank the text back.
  1579. X
  1580. XThink of ^Y as if you were yanking something back that someone took away
  1581. Xfrom you.  Notice that if you do several ^K's in a row the text that is
  1582. Xkilled is all saved together so that one ^Y will yank all of the lines.
  1583. X
  1584. X>>  Try it.  Type ^K several times.
  1585. X
  1586. X>>  To retrieve that killed text:  Type ^Y.  Move the cursor down a few
  1587. X    lines and type ^Y again.  You now know how to copy text.
  1588. X
  1589. XWhat do you do if you have some text you want to yank back, and then
  1590. Xyou kill something else?  ^Y would yank the more recent kill.
  1591. X
  1592. X>>  Kill a line, move around, kill another line.  Then do ^Y to get back
  1593. X    the second killed line.
  1594. X
  1595. X
  1596. XSEARCHING
  1597. X---------
  1598. X
  1599. XEMACS can do searches for strings (these are groups of contiguous
  1600. Xcharacters or words) either forward through the file or backward
  1601. Xthrough it.
  1602. X
  1603. X>>  Now type ^S to start a search.  Type the word "cursor", then ESC.
  1604. X
  1605. X>>  Type ^S ESC to find the next occurrence of "cursor".
  1606. X
  1607. XThe ^S starts a search that looks for any occurrence of the search
  1608. Xstring AFTER the current cursor position.  But what if you want to
  1609. Xsearch for something earlier in the text?  To do this one should
  1610. Xtype ^R for Reverse search.  Everything that applies to ^S applies
  1611. Xto ^R except that the direction of the search is reversed.
  1612. X
  1613. X
  1614. XTEXT REPLACEMENT
  1615. X----------------
  1616. X
  1617. X>>  Move the cursor to the blank line two lines below this one.
  1618. X    Then type ESC-R changed ESC altered ESC .
  1619. X
  1620. X    Notice how this line has changed; you have replaced the word
  1621. X    "changed" with "altered" wherever it occurs in the file after
  1622. X    the cursor.  After all the substitutions have been made or
  1623. X    the end of file has been reached, a message informing you of
  1624. X    the number of substitutions which have been made appears in
  1625. X    the communication line.
  1626. X
  1627. XThe more customary command for replacing strings is the interactive
  1628. Xcommand query-replace-search (ESC-^R), which has several options.  In
  1629. Xessence, it shows each occurrence of the first string and asks you if
  1630. Xyou want to replace it or not.  Type a "?" when it asks to replace the
  1631. Xstring to list the various options for query-replace-search.  For a
  1632. Xmore detailed discussion of this command refer to the EMACS manual.
  1633. X
  1634. X
  1635. XFILES
  1636. X-----
  1637. X
  1638. XIn order to make the text changes permanent, you must save them to a file.
  1639. XIf you do not save them, the changes will "disappear" when you leave EMACS.
  1640. XAs you make changes, i.e., corrections, deletions, insertions, etc., they
  1641. Xare actually written to a "scratch" copy of the file and the changes to
  1642. Xthis file will not affect the "master" copy of the file until a file save
  1643. Xis specified. This allows you to decide if changes made to the file should
  1644. Xbe made permanent or discarded.
  1645. X
  1646. XRemember:  The file name appears on the mode line.
  1647. X
  1648. X=* MicroEMACS 3.7 () == emacs.tut == File: emacs.tut ===========================
  1649. X                                     ---------------
  1650. X
  1651. XThe commands for finding and saving files are unlike the other commands
  1652. Xyou have learned so far in that they consist of two characters - a ^X
  1653. Xfollowed by another character which specifies the file command to be
  1654. Xexecuted.
  1655. X
  1656. XTo find a file, type ^X^F.  EMACS will then prompt you from the
  1657. Xcommunication line for the name of the file.  In response to the prompt,
  1658. Xtype the file name followed by a <Return> to indicate the file name has
  1659. Xbeen entered.  This command will tell EMACS to go find this file and
  1660. Xload it.  Its contents will then be displayed on the screen and you will
  1661. Xbe able to edit the file's contents.
  1662. X
  1663. XTo save any changes made to the file, type ^X^S.  This tells EMACS to
  1664. Xcreate a new version of the file which includes the changes you have
  1665. Xmade.  When the save is complete, the number of lines saved will be
  1666. Xdisplayed in the communication line.
  1667. X
  1668. XIf you edit a file and at some point decide to quit (i.e., ^X^C) without
  1669. Xsaving the changes, EMACS will remind you that changes have been made to
  1670. Xthe file and ask you if you really want to quit.  Enter "N" to return to
  1671. XEMACS or "Y" to exit EMACS without saving the changes.
  1672. X
  1673. XTo create a file, just edit it "as if" it already existed.  Then start
  1674. Xtyping in the text.  When you ask to "save" the file, EMACS will really
  1675. Xcreate the file with the text that you have entered.  From then on, you
  1676. Xcan consider yourself to be editing an existing file.
  1677. X
  1678. XIt is not easy for you to test editing a file and continue with the
  1679. Xtutorial.  But you can always come back into the tutorial by starting
  1680. Xit over and skipping forward.  So, when you feel ready, you should
  1681. Xtry editing a file named "FOO", putting some text in it, and saving
  1682. Xit; then exit EMACS and look at the file to be sure that it worked.
  1683. X
  1684. X
  1685. XEXTENDING THE COMMAND SET
  1686. X-------------------------
  1687. X
  1688. XThere are many, many more EMACS commands than could possibly be put on all
  1689. Xthe CONTROL and META characters.  EMACS gets around this with the X (eXtend)
  1690. Xcommand.  There are two forms of this command:
  1691. X
  1692. X     ^X       Character eXtend.  Followed by one character.
  1693. X     ESC-X    Named command eXtend.  Followed by a long name.
  1694. X
  1695. XThese are commands that are generally useful but used less than the commands
  1696. Xyou have already learned about.  You have already seen two of them: the file
  1697. Xcommands ^X^F to Find and ^X^S to Save.  Another example is the command to
  1698. Xtell EMACS that you'd like to stop editing.  The command to do this is ^X^C.
  1699. X
  1700. XThere are many ^X commands.  Right now, the most helpful ones will be
  1701. X
  1702. X     ^X^F   Find file.
  1703. X     ^X^S   Save file.
  1704. X     ^X^C   Quit EMACS.  This does not save your files automatically;
  1705. X              however, if your files have been modified, EMACS asks if
  1706. X              you really want to quit.  The standard way to save and
  1707. X              exit is ^X^S ^X^C.
  1708. X
  1709. XNamed eXtended commands are commands which are used even less frequently,
  1710. Xor commands which are used only in certain modes.  These commands are
  1711. Xusually called "functions".  An example is the function "apropos", which
  1712. Xprompts for a keyword and then gives the names of all the functions that
  1713. Xare apropos for that keyword.  When you type ESC-X, EMACS prompts you from
  1714. Xthe communication line with ":" and you should type the name of the
  1715. Xfunction you wish to call; in this case, "apropos".  Just type "apr<Space>"
  1716. Xand EMACS will complete the name.  EMACS will ask you for a keyword or
  1717. Xphrase and you type the string that you want information on.
  1718. X
  1719. X>>  Type ESC-X, followed by "apropos<Return>" or "apr<Space>".  Then
  1720. X    type "file" followed by a <Return>.  Note: ESC-A is equivalent to
  1721. X    the ECS-X "apropos" command.
  1722. X
  1723. X>>  To remove the "window" that was added, type ^X0 (zero).
  1724. X
  1725. X
  1726. XFUNCTION KEYS
  1727. X-------------
  1728. X
  1729. XBy now, you should be familiar with the format and meaning of some of
  1730. Xthe more common CONTROL and META commands.  Because several of these
  1731. Xcommands are used frequently, they have been bound to the function
  1732. Xkeys, which are usually located on the left-hand side of the keyboard
  1733. Xand labelled F1..F10.  By pressing the appropriate function key, one
  1734. Xcan replace several keystrokes with a single keystroke, thus saving
  1735. Xyou time as you become familiar with their use.
  1736. X
  1737. XThe highlighted portion at the top of the screen lists the commands
  1738. Xwhich are associated with each function key.  Each function key supports
  1739. Xtwo commands specified by fn or Fn where n = 1, 2,...10.  The default
  1740. Xcommands are represented by fn and are defined on the left side of the
  1741. Xscreen; these commands are executed by pressing the appropriate function
  1742. Xkey.  The secondary commands are represented by Fn and are defined on
  1743. Xthe right side of the screen; these commands are executed by pressing
  1744. Xthe <Shift> key and the appropriate function key at the same time.
  1745. X
  1746. X>>  Press f1 would ESC.  Note the position of the cursor - "would"
  1747. X    was located just as if ^S would ESC had been entered.  Enter
  1748. X    ^S would ESC to see for yourself.
  1749. X
  1750. X>>  Press F1 (<Shift> f1).  Note the different appearance of the screen.
  1751. X    You have toggled the function key list, i.e., "turned it off".  To
  1752. X    "turn it on", press F1 again.
  1753. X
  1754. X>>  Try using some of the other function keys to become familiar with
  1755. X    their use.  NOTE:  Do NOT use f9 with this file as it would save
  1756. X    any changes you may have made while using the tutorial.
  1757. X
  1758. X
  1759. XGETTING MORE HELP
  1760. X-----------------
  1761. X
  1762. XIn this tutorial we have tried to supply just enough information to get
  1763. Xyou started using EMACS.  There is so much available in EMACS that it
  1764. Xwould be impossible to explain it all here.  However, you may want to
  1765. Xlearn more about EMACS since it has numerous desirable features that you
  1766. Xdon't know about yet.
  1767. X
  1768. XThe most basic HELP feature is the describe-key function which is
  1769. Xavailable by typing ^X? and then a command character.  EMACS prints
  1770. Xone line in the communication line to tell what function is bound
  1771. Xto that key.
  1772. X
  1773. X>>  Type ^X?^P.  The message in the communication line should
  1774. X    be something like "^P is bound to previous-line".
  1775. X
  1776. XNOTE:  Multi-character commands such as ^X^Z and ESC-V are also
  1777. X       allowed after ^X? .
  1778. X
  1779. X###  The describe-command function does not work - December 1986  ###
  1780. X###  Skip to the next section                                     ###
  1781. X
  1782. XThe describe-command function (ESC-?) will prompt for the name of a
  1783. Xfunction and print out the section from the manual about that command.
  1784. XWhen you are finished reading it, type a space or a ^G (quit) to bring
  1785. Xyour text back on the screen.
  1786. X
  1787. XNow let's get more information about the previous-line command.
  1788. X
  1789. X>>  Type ESC-?^P.  When you are finished reading the output, type <Space>.
  1790. X
  1791. XThe "name of the function" is important for people who are customizing
  1792. XEMACS.  It is what appears in the EMACS CHART as the documentation for
  1793. Xthe command character.
  1794. X
  1795. X
  1796. XCONCLUSION
  1797. X----------
  1798. X
  1799. XRemember:  To EXIT use ^X^C.
  1800. X
  1801. XThis tutorial is meant to be understandable to all new users, so if
  1802. Xyou found something unclear, don't sit and blame yourself - complain!
  1803. X
  1804. XYou'll probably find that if you use EMACS for a few days you won't be
  1805. Xable to give it up.  Initially it may give you trouble.  But remember,
  1806. Xthis is the case with any editor, especially one that can do many, many
  1807. Xthings - and EMACS can do practically everything.
  1808. X
  1809. X
  1810. XACKNOWLEDGEMENTS
  1811. X----------------
  1812. X
  1813. XThis is a modified version of the "JOVE Tutorial" by Jonathan Payne
  1814. X(19 January 86).  That document was in turn a modified version of
  1815. Xthe tutorial "Teach-Emacs" from MIT as modified by Steve Zimmerman
  1816. Xat CCA-UNIX (31 October 85).
  1817. X
  1818. XUpdate - February 1986 by Dana Hoggatt.
  1819. X
  1820. XUpdate - December 1986 by Kim Leburg.
  1821. END_OF_emacs.tut
  1822. if test 29549 -ne `wc -c <emacs.tut`; then
  1823.     echo shar: \"emacs.tut\" unpacked with wrong size!
  1824. fi
  1825. # end of overwriting check
  1826. fi
  1827. echo shar: End of archive 11 \(of 14\).
  1828. cp /dev/null ark11isdone
  1829. MISSING=""
  1830. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
  1831.     if test ! -f ark${I}isdone ; then
  1832.     MISSING="${MISSING} ${I}"
  1833.     fi
  1834. done
  1835. if test "${MISSING}" = "" ; then
  1836.     echo You have unpacked all 14 archives.
  1837.     echo "See the readme file"
  1838.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1839. else
  1840.     echo You still need to unpack the following archives:
  1841.     echo "        " ${MISSING}
  1842. fi
  1843. ##  End of shell archive.
  1844. exit 0
  1845.